﻿@model List<SalesReportViewModel>
@{
    ViewBag.Title = "Today's Sales";
    Double totalSales = 0;
    Double totalProfit = 0;
    Double productProfit = 0;
}
  
 
 @foreach (var item in Model)
    {
    <ul data-role="listview" data-inset="true">
        <li data-role="list-divider">@item.productName</li>
        @{
        productProfit = item.sellingPrice - item.purchasePrice;
        totalSales = totalSales + item.sellingPrice;
        totalProfit += (item.sellingPrice - item.purchasePrice);
      }
        <li>
            Selling Price:R @Html.DisplayFor(modelItem => item.sellingPrice)
        </li>
        
        <li>
            Sold Date: @Html.DisplayFor(modelItem => item.soldDate)
        </li>

         <li>
            Product Profit: @Html.DisplayFor(modelItem => productProfit)
        </li>

      
    </ul>
    }
    
 @{
        
 }
 <ul data-role="listview" data-inset="true">
        <li data-role="list-divider">Summary</li>
       
        <li>
             Total Sales: @totalSales
        </li>
        <li>
             Total Profit: @totalProfit
        </li>

    </ul>
   
  
@*<div>

@foreach (var item in Model) {
    
       <div>
              <h4>@item.productName</h4>
        </div>
        <div>
             Selling Price: @Html.DisplayFor(modelItem => item.sellingPrice)
        </div>
        <div>
            Sold Date: @Html.DisplayFor(modelItem => item.soldDate)
            
        </div>

        <hr />
}

    </div>*@